<extend name="Base/layout" />
<block name="content">
<div class="layui-btn-group operateTable">
    <button class="layui-btn layui-btn-normal" data-type="add_diary"><i class="layui-icon" style="">&#xe654;</i>添加日记</button>
    <button class="layui-btn layui-btn-danger" data-type="delete_diary"><i class="layui-icon" style="">&#xe640;</i>批量删除</button>
</div>
<table class="layui-table layui-form" id="diary" lay-filter="diary" style="display: none;">
</table>
<script type="text/template" id="barDemo">
    <a class="layui-btn layui-btn-normal layui-btn-sm" lay-event="edit"><i class="layui-icon" style="">&#xe642;</i></a>
    <a class="layui-btn layui-btn-danger layui-btn-sm" lay-event="del"><i class="layui-icon" style="">&#xe640;</i></a>
</script>
<script type="text/template" id="add_diary_container">
    <div class="template-box">
        <form class="layui-form layui-form-pane">
            <div class="layui-form-item">
                <label class="layui-form-label">内容</label>
                <div class="layui-input-block">
                    <textarea class="layui-textarea layui-hide" name="content" lay-verify="content" id="editorDiary" placeholder="请输入日记内容">
                    </textarea>
                </div>
            </div>
            <div class="layui-form-item">
                <div class="layui-input-block">
                    <button type="button" class="layui-btn" lay-submit="" lay-filter="add-diary">确定</button>
                    <button type="button" class="layui-btn layui-btn-primary btn-cancel">取消</button>
                </div>
            </div>
        </form>
    </div>
</script>
<script type="text/template" id="edit_diary_container">
    <div class="template-box">
        <form class="layui-form layui-form-pane">
            <div class="layui-form-item">
                <label class="layui-form-label">内容</label>
                <div class="layui-input-block">
                    <textarea class="layui-textarea layui-hide" name="content" lay-verify="content" id="edit_editorDiary" placeholder="请输入日记内容">
                    </textarea>
                </div>
            </div>
            <div class="layui-form-item">
                <div class="layui-input-block">
                    <button type="button" class="layui-btn" lay-submit="" lay-filter="edit-diary">确定</button>
                    <button type="button" class="layui-btn layui-btn-primary btn-cancel">取消</button>
                </div>
            </div>
        </form>
    </div>
</script>
</block>
<block name="javascript">
    <script type="text/javascript" src="__JS__/diary.js"></script>
    <script type="text/javascript" src="__JS__/jquery.dataTables.min.js"></script>
    <script type="text/javascript">

        $(function(){
            Diary.initialize();
            Base.urls = {diary:"{:U('/Admin/diary/index')}",addDiary:"{:U('Admin/diary/addDiary')}",deleteDiary:"{:U('Admin/diary/deleteDiary')}",
                findOne:"{:U('Admin/diary/findOne')}",editDiary:"{:U('Admin/diary/editDiary')}",page:"{:U('Admin/diary/page')}"};
            
        });
    </script>
</block>